﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MCK_Reason_TimeKeeper.ascx.cs" Inherits="ERP.Modules.MCK_Reason_TimeKeeper" %>
<%-------------------------------%>
<ext:Hidden ID="FormatTypeMCK_Reason_TimeKeeper" runat="server" />
<%--------------GridMCK_Reason_TimeKeeper-----------------%>
<ext:Panel runat="server" Layout="Fit" Border="False" ID="PanelMCK_Reason_TimeKeeper">
    <Content>
        <ext:GridPanel
            runat="server"
            ID="grMCK_Reason_TimeKeeper"
            Header="False"
            Border="False"
            Cls="grid-double">
            <Store>
                <ext:Store runat="server" ID="StoreMCK_Reason_TimeKeeper" PageSize="20" OnReadData="StoreMCK_Reason_TimeKeeper_RefreshData">
                    <Model>
                        <ext:Model ID="Model1" runat="server" IDProperty="Reason_TimeKeeper_ID">
                            <Fields>
                                <ext:ModelField Name="Bank_Code" />
                                <ext:ModelField Name="FullName" />
                                <ext:ModelField Name="Date" Type="Date" />
                                <ext:ModelField Name="Symbol_TimeKeeper_Alias" />
                                <ext:ModelField Name="Symbol_TimeKeeper_Name" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
            </Store>
            <ColumnModel runat="server">
                <Columns>
                    <ext:RowNumbererColumn ID="RowNumbererColumn1" runat="server" Text="STT" Width="35" />
                    <ext:DateColumn ID="Column2" runat="server" Text="Ngày" Flex="1" DataIndex="Date" Format="dd-MM-yyyy" />
                    <ext:Column ID="Column1" runat="server" Text="Mã nhân viên" Flex="1" DataIndex="Bank_Code" />
                    <ext:Column ID="Column5" runat="server" Text="Nhân viên" Flex="1" DataIndex="FullName" />
                    <ext:Column ID="Column3" runat="server" Text="Kí hiệu" Flex="1" DataIndex="Symbol_TimeKeeper_Alias" />
                    <ext:Column ID="Column6" runat="server" Text="Lý do nghỉ" Flex="1" DataIndex="Symbol_TimeKeeper_Name" />
                </Columns>
            </ColumnModel>
            <SelectionModel>
                <ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server" Mode="Multi">
                    <Listeners>
                        <SelectionChange Handler="
                            if (selected.length == 0) {
                                #{btnEdit}.disable();
                                #{btnDel}.disable();
                                #{btnExport}.disable();
                            } else {
                                #{btnEdit}.enable();
                                #{btnDel}.enable();
                                #{btnExport}.enable();
                            }" />
                    </Listeners>
                </ext:CheckboxSelectionModel>
            </SelectionModel>
            <DirectEvents>
                <ItemDblClick OnEvent="MCK_Reason_TimeKeeper_DblClick">
                    <ExtraParams>
                        <ext:Parameter Name="Reason_TimeKeeper_ID" Value="record.data.Reason_TimeKeeper_ID" Mode="Raw" />
                    </ExtraParams>
                    <EventMask ShowMask="true" Msg="Đang tải..." />
                </ItemDblClick>
            </DirectEvents>
            <View>
                <ext:GridView ID="GridView1" runat="server" LoadMask="false" />
            </View>
            <DockedItems>
                <ext:Toolbar ID="Toolbar1" runat="server" Dock="Top">
                    <Items>
                        <ext:Button ID="btnAddNew" runat="server" Text="Thêm mới" Icon="ApplicationAdd">
                            <DirectEvents>
                                <Click OnEvent="btnAddNew_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Click>
                            </DirectEvents>
                        </ext:Button>

                        <ext:Button ID="btnEdit" runat="server" Text="Sửa" Icon="ApplicationEdit">
                            <DirectEvents>
                                <Click OnEvent="btnEdit_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Click>
                            </DirectEvents>
                        </ext:Button>

                        <ext:Button ID="btnDel" runat="server" Text="Xoá" Icon="ApplicationDelete">
                            <DirectEvents>
                                <Click OnEvent="btnDel_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                    <ExtraParams>
                                        <ext:Parameter Name="name" Value="btnDel"></ext:Parameter>
                                    </ExtraParams>
                                    <Confirmation ConfirmRequest="true"
                                        Title="Thông Báo" Message="Bạn có muốn xoá mẫu tin này không ?">
                                    </Confirmation>
                                </Click>
                            </DirectEvents>
                        </ext:Button>

                        <ext:Button ID="btnExport" runat="server" Text="Xuất tập tin" Icon="Printer">
                            <Menu>
                                <ext:Menu ID="MenuMain" runat="server">
                                    <Items>
                                        <ext:MenuItem ID="MenuItemExportXML" runat="server" Text="XML" Icon="PageCode">
                                            <Listeners>
                                                <Click Handler="submitValue(#{grMCK_Reason_TimeKeeper}, #{FormatTypeMCK_Reason_TimeKeeper}, 'xml');" />
                                            </Listeners>
                                        </ext:MenuItem>
                                    </Items>
                                </ext:Menu>
                            </Menu>
                        </ext:Button>
                    </Items>
                </ext:Toolbar>
                <ext:Toolbar ID="Toolbar2" runat="server" Dock="Bottom">
                    <Items>
                        <ext:TriggerField ID="txtSearch" runat="server" Width="200" EnableKeyEvents="true" MarginSpec="0 8 0 0">
                            <Triggers>
                                <ext:FieldTrigger Icon="Search" />
                            </Triggers>
                        </ext:TriggerField>
                        <ext:PagingToolbar ID="PagingToolbar1"
                            runat="server"
                            BeforePageText="Trang"
                            AfterPageText="của {0}"
                            LastText="Cuối" NextText="Kế tiếp"
                            PrevText="Trở lại" FirstText="Đầu"
                            RefreshText="Làm tươi"
                            DisplayInfo="true"
                            DisplayMsg="Trang {0} - {1} của {2}"
                            Border="False"
                            StoreID="StoreMCK_Reason_TimeKeeper">
                        </ext:PagingToolbar>
                    </Items>
                </ext:Toolbar>
            </DockedItems>
        </ext:GridPanel>
    </Content>
</ext:Panel>
<ext:Panel ID="Panel1" runat="server">
    <Content>
        <ext:Window ID="WindowsMCK_Reason_TimeKeeper" runat="server"
            Title="Cập nhật giờ làm việc"
            Width="345"
            Frame="True"
            Hidden="true"
            Region="Center"
            Modal="true"
            Border="false"
            PaddingSummary="5px 5px 0"
            DefaultButton="btnSavePopUp"
            Resizable="False">
            <Items>
                <ext:Toolbar ID="ToolbarMCK_Reason_TimeKeeper" runat="server">
                    <Items>
                        <ext:Button runat="server" Text="Lưu lại" Icon="Disk" ID="btnSavePopUp">
                            <DirectEvents>
                                <Click OnEvent="btnSavePopUp_Click" Before="return #{FormPanelMCK_Reason_TimeKeeper}.isValid();">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                        <ext:Button runat="server" Text="Huỷ bỏ" Icon="Decline" ID="btnCancelPopUp" OnClientClick="WindowsMCK_Reason_TimeKeeper.hide();" />
                        <ext:TextField ID="txtReason_TimeKeeper_ID" runat="server" FieldLabel="ID" LabelAlign="Right" Hidden="true" />
                    </Items>
                </ext:Toolbar>
                <ext:FormPanel ID="FormPanelMCK_Reason_TimeKeeper" runat="server"
                    AutoHeight="true"
                    Border="False"
                    BodyPadding="10"
                    Frame="True"
                    DefaultAnchor="100%">
                    <Items>
                        <ext:ComboBox runat="server" ID="txtEnroll_Number" FieldLabel="Nhân viên" />
                        <ext:DateField runat="server" ID="txtDate" FieldLabel="Ngày" />
                        <ext:ComboBox runat="server" ID="txtSymbol_TimeKeeper_ID" FieldLabel="Lý do nghỉ" />
                    </Items>
                </ext:FormPanel>
            </Items>
        </ext:Window>
    </Content>
</ext:Panel>
